<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script  type="text/javascript" src="js/script.js"></script>
        <link type="text/css" rel="stylesheet" href="css/style.css"/>
    </head>
    <body>
        <div id="content">
            <h1>Consultas</h1>
            <div id="menu">
                <ul>
                    <li><a href="homeSecretary.jsp"> Página Inicial</a></li>
                    <li><a href="ConsultaServlet?page=addConsulta"> Marcar Consulta</a></li>  
                </ul>
            </div>
            <table>
                <thead>
                    <td>Data</td>
                    <td>Horário</td>
                    <td>Paciente</td>
                    <td>Médico</td>
                    <td>Remarcar</td>  
                    <td>Excluir</td> 
                </thead>
                <c:forEach items="${consultas}" var="consulta">
                <tr>
                    <td><c:out value="${consulta.horario}"/></td>
                    <td><c:out value="${consulta.hora}"/></td>
                    <td><c:out value="${consulta.paciente.nome}"/></td>
                    <td><c:out value="${consulta.medico}"/></td>
                    <td><a href="ConsultaServlet?page=renderEditar&id=${consulta.ID}"><img src="img/edit.png" border="0" width="20"/></a></td>
                    <td><a href="ConsultaServlet?page=excluir&id=${consulta.ID}"><img src="img/del.png" border="0" width="20"/></a></td>
                </tr>	
                </c:forEach>                
            </table>
        </div>
    </body>
</html>
